<?php
defined('IN_IA') or exit('Access Denied');
global $_GPC, $_W;
//系统配置

$config=$this->config();
$member=m('member')->get_uidopenid();


$op=!empty($_GPC['op'])?$_GPC['op']:'index';
if ($op=='index') {


    include $this->template('person/index');

	
}elseif($op=='ziliao'){
    $re=pdo_get('xuan_hb_ziliao',['uid'=>$member['uid']]);

    $re['info']=json_decode($re['content'],1);

    include $this->template('person/ziliao');

}elseif($op=='savezl'){
header('Content-type: application/json');

$re=pdo_get('xuan_hb_ziliao',['uid'=>$member['uid']]);
if($re){

    pdo_update('xuan_hb_ziliao',['content'=>json_encode(['username'=>$_GPC['username'], 'phone'=>$_GPC['phone'], 'avatar'=>$_GPC['avatar']])],['uid'=>$member['uid']]);

}else{

    pdo_insert('xuan_hb_ziliao',[
        'uid'=>$member['uid'],
        'createtime'=>time(),
        'uniacid'=>$_W['uniacid'],
        'content'=>json_encode(['username'=>$_GPC['username'], 'phone'=>$_GPC['phone'], 'avatar'=>$_GPC['avatar']])
    ]);

}

echo json_encode(['status'=>0,'message'=>'保存成功']);
}

	
 
